using dnAnalytics.Math;
using NUnit.Framework;

namespace dnAnalytics.Tests.Math
{
    [TestFixture]
    public class ComplexMath_AsinhTest
    {
        [Test]
        public void Asinh()
        {
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(0.0, 1.19209289550780998537e-7)), new Complex(0.0, 1.19209289550781280881e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(0.0, -1.19209289550780998537e-7)), new Complex(0.0, -1.19209289550781280881e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(0.0, 5.0e-1)), new Complex(0.0, 5.23598775598298873077e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(0.0, -5.0e-1)), new Complex(0.0, -5.23598775598298873077e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(0.0, 1.0)), new Complex(0.0, 1.57079632679489661923), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(0.0, -1.0)), new Complex(0.0, -1.57079632679489661923), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(0.0, 2.0)), new Complex(1.31695789692481670863, 1.57079632679489661923), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(0.0, 8.388608e6)), new Complex(1.66355323334386838733e1, 1.57079632679489661923), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, 0.0)), new Complex(1.19209289550780716193e-7, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, 0.0)), new Complex(-1.19209289550780716193e-7, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, 1.19209289550780998537e-7)), new Complex(1.19209289550781563226e-7, 1.19209289550780433848e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, -1.19209289550780998537e-7)), new Complex(1.19209289550781563226e-7, -1.19209289550780433848e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, 1.19209289550780998537e-7)), new Complex(-1.19209289550781563226e-7, 1.19209289550780433848e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, -1.19209289550780998537e-7)), new Complex(-1.19209289550781563226e-7, -1.19209289550780433848e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, 5.0e-1)), new Complex(1.37651030824094033271e-7, 5.23598775598293403317e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, -5.0e-1)), new Complex(1.37651030824094033271e-7, -5.23598775598293403317e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, 5.0e-1)), new Complex(-1.37651030824094033271e-7, 5.23598775598293403317e-1), 8);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, -5.0e-1)), new Complex(-1.37651030824094033271e-7, -5.23598775598293403317e-1), 8);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, 1.0)), new Complex(3.45266986431162764654e-4, 1.57045105981532529509), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, -1.0)), new Complex(3.45266986431162764654e-4, -1.57045105981532529509), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, 1.0)), new Complex(-3.45266986431162764654e-4, 1.57045105981532529509), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, -1.0)), new Complex(-3.45266986431162764654e-4, -1.57045105981532529509), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, 2.0)), new Complex(1.31695789692481944351, 1.57079625796938120718), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, -2.0)), new Complex(1.31695789692481944351, -1.57079625796938120718), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, 2.0)), new Complex(-1.31695789692481944351, 1.57079625796938120718), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, -2.0)), new Complex(-1.31695789692481944351, -1.57079625796938120718), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, 8.388608e6)), new Complex(1.66355323334386838733e1, 1.57079632679488240838), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.19209289550780998537e-7, -8.388608e6)), new Complex(1.66355323334386838733e1, -1.57079632679488240838), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, 8.388608e6)), new Complex(-1.66355323334386838733e1, 1.57079632679488240838), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.19209289550780998537e-7, -8.388608e6)), new Complex(-1.66355323334386838733e1, -1.57079632679488240838), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, 0.0)), new Complex(4.81211825059603447498e-1, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, 0.0)), new Complex(-4.81211825059603447498e-1, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, 1.19209289550780998537e-7)), new Complex(4.81211825059605989613e-1, 1.06624029994000753133e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, -1.19209289550780998537e-7)), new Complex(4.81211825059605989613e-1, -1.06624029994000753133e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, 1.19209289550780998537e-7)), new Complex(-4.81211825059605989613e-1, 1.06624029994000753133e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, -1.19209289550780998537e-7)), new Complex(-4.81211825059605989613e-1, -1.06624029994000753133e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, 5.0e-1)), new Complex(5.30637530952517826017e-1, 4.52278447151190682064e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, -5.0e-1)), new Complex(5.30637530952517826017e-1, -4.52278447151190682064e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, 5.0e-1)), new Complex(-5.30637530952517826017e-1, 4.52278447151190682064e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, -5.0e-1)), new Complex(-5.30637530952517826017e-1, -4.52278447151190682064e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, 1.0)), new Complex(7.32857675973645260889e-1, 8.95907481208890239067e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, -1.0)), new Complex(7.32857675973645260889e-1, -8.95907481208890239067e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, 1.0)), new Complex(-7.32857675973645260889e-1, 8.95907481208890239067e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, -1.0)), new Complex(-7.32857675973645260889e-1, -8.95907481208890239067e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, 2.0)), new Complex(1.36180090085784578821, 1.29304207023718265905), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, -2.0)), new Complex(1.36180090085784578821, -1.29304207023718265905), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, 2.0)), new Complex(-1.36180090085784578821, 1.29304207023718265905), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, -2.0)), new Complex(-1.36180090085784578821, -1.29304207023718265905), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, 8.388608e6)), new Complex(1.66355323334386856497e1, 1.57079626719025184384), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(5.0e-1, -8.388608e6)), new Complex(1.66355323334386856497e1, -1.57079626719025184384), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, 8.388608e6)), new Complex(-1.66355323334386856497e1, 1.57079626719025184384), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-5.0e-1, -8.388608e6)), new Complex(-1.66355323334386856497e1, -1.57079626719025184384), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, 0.0)), new Complex(8.81373587019543025233e-1, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, 0.0)), new Complex(-8.81373587019543025233e-1, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, 1.19209289550780998537e-7)), new Complex(8.81373587019545537381e-1, 8.42936970217878358509e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, -1.19209289550780998537e-7)), new Complex(8.81373587019545537381e-1, -8.42936970217878358509e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, 1.19209289550780998537e-7)), new Complex(-8.81373587019545537381e-1, 8.42936970217878358509e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, -1.19209289550780998537e-7)), new Complex(-8.81373587019545537381e-1, -8.42936970217878358509e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, 5.0e-1)), new Complex(9.2613303135018242455e-1, 3.49439062857213293627e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, -5.0e-1)), new Complex(9.2613303135018242455e-1, -3.49439062857213293627e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, 5.0e-1)), new Complex(-9.2613303135018242455e-1, 3.49439062857213293627e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, -5.0e-1)), new Complex(-9.2613303135018242455e-1, -3.49439062857213293627e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, 1.0)), new Complex(1.06127506190503565203, 6.66239432492515255104e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, -1.0)), new Complex(1.06127506190503565203, -6.66239432492515255104e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, 1.0)), new Complex(-1.06127506190503565203, 6.66239432492515255104e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, -1.0)), new Complex(-1.06127506190503565203, -6.66239432492515255104e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, 2.0)), new Complex(1.46935174436818527326, 1.06344002357775205619), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, -2.0)), new Complex(1.46935174436818527326, -1.06344002357775205619), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, 2.0)), new Complex(-1.46935174436818527326, 1.06344002357775205619), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, -2.0)), new Complex(-1.46935174436818527326, -1.06344002357775205619), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, 8.388608e6)), new Complex(1.66355323334386909787e1, 1.57079620758560706845), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(1.0, -8.388608e6)), new Complex(1.66355323334386909787e1, -1.57079620758560706845), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, 8.388608e6)), new Complex(-1.66355323334386909787e1, 1.57079620758560706845), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-1.0, -8.388608e6)), new Complex(-1.66355323334386909787e1, -1.57079620758560706845), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, 0.0)), new Complex(1.44363547517881034249, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, 0.0)), new Complex(-1.44363547517881034249, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, 1.19209289550780998537e-7)), new Complex(1.44363547517881161355, 5.33120149970003008054e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, -1.19209289550780998537e-7)), new Complex(1.44363547517881161355, -5.33120149970003008054e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, 1.19209289550780998537e-7)), new Complex(-1.44363547517881161355, 5.33120149970003008054e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, -1.19209289550780998537e-7)), new Complex(-1.44363547517881161355, -5.33120149970003008054e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, 5.0e-1)), new Complex(1.46571535194729052178, 2.21018635622883858902e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, -5.0e-1)), new Complex(1.46571535194729052178, -2.21018635622883858902e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, 5.0e-1)), new Complex(-1.46571535194729052178, 2.21018635622883858902e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, -5.0e-1)), new Complex(-1.46571535194729052178, -2.21018635622883858902e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, 1.0)), new Complex(1.52857091948099816127, 4.27078586392476125481e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, -1.0)), new Complex(1.52857091948099816127, -4.27078586392476125481e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, 1.0)), new Complex(-1.52857091948099816127, 4.27078586392476125481e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, -1.0)), new Complex(-1.52857091948099816127, -4.27078586392476125481e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, 2.0)), new Complex(1.73432452148796644796, 7.54249144698046040708e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, -2.0)), new Complex(1.73432452148796644796, -7.54249144698046040708e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, 2.0)), new Complex(-1.73432452148796644796, 7.54249144698046040708e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, -2.0)), new Complex(-1.73432452148796644796, -7.54249144698046040708e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, 8.388608e6)), new Complex(1.6635532333438712295e1, 1.57079608837631751767), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(2.0, -8.388608e6)), new Complex(1.6635532333438712295e1, -1.57079608837631751767), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, 8.388608e6)), new Complex(-1.6635532333438712295e1, 1.57079608837631751767), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-2.0, -8.388608e6)), new Complex(-1.6635532333438712295e1, -1.57079608837631751767), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, 0.0)), new Complex(1.66355323334386909787e1, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, 0.0)), new Complex(-1.66355323334386909787e1, 0.0), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, 1.19209289550780998537e-7)), new Complex(1.66355323334386909787e1, 1.42108547152018727665e-14), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, -1.19209289550780998537e-7)), new Complex(1.66355323334386909787e1, -1.42108547152018727665e-14), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, 1.19209289550780998537e-7)), new Complex(-1.66355323334386909787e1, 1.42108547152018727665e-14), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, -1.19209289550780998537e-7)), new Complex(-1.66355323334386909787e1, -1.42108547152018727665e-14), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, 5.0e-1)), new Complex(1.66355323334386927551e1, 5.96046447753901308974e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, -5.0e-1)), new Complex(1.66355323334386927551e1, -5.96046447753901308974e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, 5.0e-1)), new Complex(-1.66355323334386927551e1, 5.96046447753901308974e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, -5.0e-1)), new Complex(-1.66355323334386927551e1, -5.96046447753901308974e-8), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, 1.0)), new Complex(1.66355323334386980842e1, 1.19209289550779838278e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, -1.0)), new Complex(1.66355323334386980842e1, -1.19209289550779838278e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, 1.0)), new Complex(-1.66355323334386980842e1, 1.19209289550779838278e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, -1.0)), new Complex(-1.66355323334386980842e1, -1.19209289550779838278e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, 2.0)), new Complex(1.66355323334387194004e1, 2.38418579101556288425e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, -2.0)), new Complex(1.66355323334387194004e1, -2.38418579101556288425e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, 2.0)), new Complex(-1.66355323334387194004e1, 2.38418579101556288425e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, -2.0)), new Complex(-1.66355323334387194004e1, -2.38418579101556288425e-7), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, 8.388608e6)), new Complex(1.69821059237186600807e1, 7.85398163397446533259e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(8.388608e6, -8.388608e6)), new Complex(1.69821059237186600807e1, -7.85398163397446533259e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, 8.388608e6)), new Complex(-1.69821059237186600807e1, 7.85398163397446533259e-1), 9);
            TestHelper.TestSignificantDigits(ComplexMath.Asinh(new Complex(-8.388608e6, -8.388608e6)), new Complex(-1.69821059237186600807e1, -7.85398163397446533259e-1), 9);
        }
    }
}